//
//  IconTextfieldView.m
//  research
//
//  Created by 章鱼 on 17/3/28.
//  Copyright © 2017年 simon. All rights reserved.
//

#import "IconTextfieldView.h"

@implementation IconTextfieldView

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self  setIconTextfieldView];
        [self setBackgroundColor:[UIColor whiteColor]];
        self.layer.borderColor = [UIColor orz_stroke].CGColor;
        self.layer.borderWidth = 0.5f;
    }
    return self;
}

- (void)setIconTextfieldView {
    _icon = [[UIImageView alloc] init];
    _icon.contentMode =  UIViewContentModeScaleAspectFill;
    _icon.autoresizingMask = UIViewAutoresizingFlexibleHeight;
    [self addSubview:_icon];
    
    _textFiled = [[UITextField alloc] init];
    [self addSubview:_textFiled];
    _textFiled.font = [UIFont systemFontOfSize:13];
    _textFiled.textAlignment = NSTextAlignmentLeft;
    _textFiled.textColor = [UIColor orz_textTitle];
    
    [self setUI];
}

- (void)setUI {
    [_icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self);
        make.left.mas_equalTo(12.f);
        make.size.mas_equalTo(CGSizeMake(15, 22));
        
    }];
    
    [_textFiled mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self);
        make.left.mas_equalTo(42.f);
        make.width.mas_equalTo(self);
        make.height.mas_equalTo(self);
        
    }];
}

@end
